<?php

/**
 * file助手
 */

class Helper_File extends YOU{

	/** 递归获取指定目录下的文件名列表 **/
	function get_all_files($path, &$array){
		if(is_dir($path)){
			$dp = dir($path);
			while($file = $dp->read())
			if($file != '.' && $file != '..') {
				self::get_all_files($path . '/' . $file, $array);
			}
			$dp->close();
		} else {
			$tmp = file_get_contents($path);
			$match = "/<title>(.*)-pdf2text/siU";
			preg_match($match, $tmp, $matches);
			$array[$path."|".strip_tags($matches[1])] = filemtime($path);
		}
	}
}

